﻿@using TinyMoocSite.ViewModels
@model HomeworkFullItem

@{
    ViewBag.Title = "完成作业";
    Layout = "~/Views/Student/CoursePageLayout.cshtml";
}

@section Homework { active }

@section RightContainer
{
    <h4>完成作业&raquo;@Model.HomeworkTitle</h4><hr />
    <br /><br />

    <form role="form" action="/Student/DoCompleteHomework" method="post" enctype="multipart/form-data" class="update-form form-horizontal" >
        <input type="hidden" name="Id" class="form-control" id="form-id" value="@Model.Id">
        <input type="hidden" name="HomeworkId" class="form-control" id="form-id" value="@Model.HomeworkId">

        @for (int i = 0; i < Model.Problems.Count; i++)
        {
            ProblemData item = Model.Problems[i];

            <div class="panel panel-success">
                <div class="panel-heading">
                    <h3 class="panel-title">第 @(i + 1) 题（题库编号：@item.Id）</h3>
                </div>
                <div class="panel-body">
                    @Html.Raw(item.Body)
                    <hr />
                    <p>A. @item.CandidateFirst</p>
                    <p>B. @item.CandidateSecond</p>
                    <p>C. @item.CandidateThird</p>
                    <p>D. @item.CandidateFourth</p>
                    <hr />

                    <div class="form-group">
                        <label for="form-answer-@i" class="col-sm-2 control-label">我的答案</label>
                        <div class="col-sm-10">
                            <input type="text" name="AnswerList" class="form-control" id="form-answer-@i">
                        </div>
                    </div>
                </div>
            </div>
        }

        <div class="text-center">
            <button type="submit" class="btn btn-default">提交作业</button>
            &nbsp;&nbsp;
            <button type="button" class="btn btn-default" onclick="history.back();">返回</button>
        </div>

        <br /><br />
    </form>    
}